﻿@model PagedList.StaticPagedList<NewRen.Models.ViewModel.vBusiness>
@using NewRen.Models.ViewModel
@using NewRen.Models
@using PagedList
@using PagedList.Mvc

@{
    ViewBag.Title = "商家";
    Layout = "~/Views/Shared/_Layout.cshtml";
    List<Industry> Industries = ViewBag.Industries as List<Industry>;
    List<City> Cities = ViewBag.City as List<City>;
}
<script>
    $("#nav_business").attr("class", "item_selected");
</script>
<link href="~/Content/PagedList.css" rel="stylesheet" />
<div class="container top20">
    <div class="filter-box">
        <form action="/" method="post">
            <div class="fieldset" style="border-top:none;">
                <h4 class="legend">城市</h4>
                <div class="items">
                    <input type="hidden" id="city" value="@ViewBag.City" />
                    <a href="javascript:void(0)" class="bubtn all @(ViewBag.City==""?"seled":"")">全部</a>
                    @foreach (var item in ViewBag.Cities)
                    {
                        <a href="javascript:void(0)" class="bubtn @(ViewBag.City==@item.CityName?"seled":"")">@item.CityName</a>
                    }
                    @if (ViewBag.CitiesMore.Count > 0)
                    {
                        <a href="javascript:void(0)" id="btnCityMore" class="items-more">更多>></a>
                        foreach (var item in ViewBag.CitiesMore)
                        {
                            <a href="javascript:void(0)" class="city_items bubtn @(ViewBag.City==item.CityName?"seled":"")" style="display:none">@item.CityName</a>
                        }
                    }
                </div>
            </div>

            <div class="fieldset">
                <h4 class="legend">行业</h4>
                <div class="items">
                    <input type="hidden" id="industry" value="@ViewBag.Industry" />
                    <a href="javascript:void(0)" class="bubtn all @(ViewBag.Industry==""?"seled":"")">全部</a>
                    @foreach (var item in ViewBag.Industries)
                    {
                        <a href="javascript:void(0)" class="bubtn @(ViewBag.Industry==item.IndustryName?"seled":"")">@item.IndustryName</a>
                    }
                    @if (ViewBag.IndustriesMore.Count > 0)
                    {
                        <a href="javascript:void(0)" id="btnIndustryMore" class="items-more">更多>></a>
                        foreach (var item in ViewBag.IndustriesMore)
                        {
                            <a href="javascript:void(0)" class="industry_items bubtn @(ViewBag.Industry==item.IndustryName?"seled":"")" style="display:none">@item.IndustryName</a>
                        }
                    }
                </div>
            </div>
        </form>
    </div>
</div>
<div class="container">
    <div class="list-box">
        @if (Model.Count() > 0)
        {
            <div class="clearfix">
                @foreach (var item in Model)
                {
                    <dl class="fl">
                        <dt>
                            <a href="/UserGroup/UserGroupShow/@item.ID" target="_blank">
                                @if (item.Picture != null)
                                {
                                    <img src="/Business/ShowPicture/@item.ID" class="headPhoto" />
                                }
                                else
                                {
                                    <img src="~/Images/userphoto.png" class="headPhoto" />
                                }
                            </a>
                        </dt>
                        <dd>
                            <ul>
                                <li class="name">商家：<a href="/Business/BusinessShow/@item.ID" target="_blank"><em class="highliht">@item.BusinessName</em></a></li>
                                <li>行业：@item.Industry</li>
                                <li>城市：@item.City</li>
                                <li>
                                    介绍：@item.Description
                                </li>
                                <li>点赞：@item.Ups</li>
                            </ul>
                        </dd>
                    </dl>
                }
            </div>
            <div class="left-2">@Html.PagedListPager((IPagedList)Model, page => Url.Action("Index", new { page = page }))</div>
        }
        else
        {
            <div>暂无数据~~~</div>
        }
    </div>
</div>

